package com.redis;

import org.redisson.Redisson;
import org.redisson.config.Config;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;

/**
 * @Author： yu.Tan
 * @Date: 2020/9/1 10:05
 * @Description:
 */
@SpringBootApplication
public class RedisConsumerApplication {
    public static void main(String[] args) {
        SpringApplication.run(RedisConsumerApplication.class,args);
    }

    @Bean
    public Redisson redisson(){
        Config config=new Config() ;
        config.useSingleServer().setAddress("redis://127.0.0.1:6379").setDatabase(0);
//        config.useSingleServer().setPassword("123456");
        return (Redisson) Redisson.create(config);
    }
}
